<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<?php
require_once("class/PrayList.php");
require_once("class/Tool.php");

$praylist = new PrayList(5); 

$post_data = array('return_message' => '', 'page' => 1);

	if ($_POST["pid"] == "")
	{
		if($_POST["subject"] == "")
		  $post_data = array('return_message' => 'subject', 'page' => 1);
		else if ($_POST["prayer"] == "" )
		  $post_data = array('return_message' => 'prayer', 'page' => 1);
		else if ($_POST["message"] == "" )  
		  $post_data = array('return_message' => 'message', 'page' => 1);
		else
		{
		  $praylist->setPray($_POST["subject"], $_POST["message"], $_POST["prayer"], $_POST["status"]);
		  $post_data = array('return_message' => 'sucess', 'page' => 1);
		}
	}
	Tool::redirect_post("pray.php", $post_data);
	
?>
</body>	
</html>